package com.yaowk.sfp.security.api;

import com.yaowk.sfp.security.api.model.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("security")
@RequestMapping("/auth")
public interface AuthApi {

    @PostMapping("/login")
    void login(String username, String password);

    @PostMapping("/logout")
    void logout();

    @GetMapping("/userInfo")
    User userInfo();

    @GetMapping("/userInfo/{token}")
    User userInfo(@PathVariable String token);

    @GetMapping("/userId")
    Long getUserId();
}
